package Dao

import (
	"backend/Service/snowFlakeService"
	"gorm.io/gorm"
	"time"
)

type TopicDiscussion struct {
	Model
	Content     string
	Topic       string
	SponsorId   int `json:"SponsorId,string"`
	IfDone      int `json:"IfDone,string" map:"IfDone" `
	IfTeacher   int `json:"IfTeacher,string" map:"IfTeacher" `
	IfImportant int `json:"IfImportant,string" map:"IfImportant" `
	MsgCount    int
}

type Student struct {
	Model
	StuName  string
	StuNum   string
	StuPwd   string
	StuClass string
	StuAva   string
}

type ContentsDiscussion struct {
	Model
	Content     string
	SpeakerId   int `json:"SpeakerId,string"`
	TopicId     int `json:"TopicId,string"`
	SpeakerName string
}

type RepContentDiscussion struct {
	Model
	ContentsDiscussionId int `json:"ContentsDiscussionId,string"`
	RepRepId             int `json:"RepRepId,string"`
	RepRepName           string
	SpeakerId            int `json:"SpeakerId,string"`
	SpeakerName          string
	Content              string
}

type Class struct {
	Model
	ClassName string
}
type StuHomework struct {
	Model
	HomeworkId int `json:"HomeworkId,string"`
	StuId      int `json:"StuId,string"`
	Status     int `json:"Status,string"`
	Score      int `json:"Score,string"`
}
type Teacher struct {
	Model
	TeacherName     string
	TeacherPwd      string
	TeacherUsername string
	TeacherAva      string
}
type Model struct {
	ID        uint `gorm:"primarykey" json:"ID,string"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

func GetModel() Model {
	return Model{
		ID:        uint(snowFlakeService.GetInt64Snow()),
		CreatedAt: time.Time{},
		UpdatedAt: time.Time{},
		DeletedAt: gorm.DeletedAt{},
	}
}

type CurriculumSeries struct {
	Model
	CurriculumSeriesName     string
	CurriculumSeriesDescribe string
}

type Curriculum struct {
	Model
	CurriculumYear     string
	CurriculumSeriesId int `json:"CurriculumSeriesId,string"`
	CurriculumData     string
}

type Chapter struct {
	Model
	ChapterName     string
	ChapterSort     int `json:"ChapterSort,string"`
	ChapterDescribe string
	ChapterData     string
	CurriculumId    int `json:"CurriculumId,string"`
}

type Homework struct {
	Model
	HomeworkName     string
	HomeworkDescribe string
	EndTime          time.Time
	CurriculumId     int `json:"CurriculumId,string"`
	StartTime        time.Time
}

type HomeworkFile struct {
	Model
	HomeworkId int `json:"HomeworkId,string"`
	StuId      int `json:"StuId,string"`
	Md5        string
	FileUrl    string
}

type DataSpace struct {
	Model
	DataName string `json:"name"`
	DataUrl  string `json:"url"`
}

type StudentCurriculum struct {
	Model
	StuId        int `json:"StuId,string"`
	CurriculumId int `json:"CurriculumId,string"`
}
